package cn.edu.zut.hhr.service;

import cn.edu.zut.hhr.entity.Dept;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class DeptServiceClientFallbackFactory implements FallbackFactory<DeptService> {
    @Override
    public DeptService create(Throwable throwable) {
        return new DeptService() {
            @Override
            public Dept getById(long id) {
                //这里写个这个吧暂时,RestResponse对象,那个的msg为信息,data为null就行
                return new Dept("该服务暂停服务","null");
            }
        };
    }
}
